<template>
  <div class="todo-header">
    <input
      type="text"
      id="newTodo"
      v-model="msg"
      @keyup.enter="changeList(msg)"
      placeholder="请输入您的任务，回车确认"
    />
  </div>
</template>

<script>
export default {
  name: "TodoHeader",
  props:{
    addList:Function
  },
  data() {
    return {
      msg: "",
    };
  },
  methods:{
    changeList(value){
      this.addList(value)
      this.msg = ""
    }
  },
  mounted(){
  }
};
[].unshift;
</script>

<style>
</style>